package top.skihub.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import top.skihub.pojo.Goods;

import java.util.List;

/**
 * 商品搜索
 */
@Service
@Mapper
public interface SearchGoodsMapper {
    /**
     * 商品搜索
     * @return 返回所有商品列表
     */
    @Select("select * from goods;")
    List<Goods> list1();

    /**
     * 商品搜索
     */
    @Select("select * from goods where goods_name like concat('%',#{goodsName},'%')")
    List<Goods> list2(String goodsName);
}